

<% if  @isError == true %>
<div class="row">  
  <div class="col-md-offset-4 col-md-6">
     <div class="alert alert-warning alert-dismissible" role="alert">
      <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
      <strong>Error!</strong> Ah ingresado numeros duplicados.
    </div>
    
  </div>
</div>
<% end %>

<div class="row" style="margin: 10px;">
  <div class="col-md-12">
    <div class="panel panel-default">
      <div class="panel-body">      
        <h3 style= "color: gold;"><strong>Haga su apuesta </strong></h3>
        <%= form_for [@gamble.user, @gamble] do |f| %>
         <div class="row">
            <div class="col-md-4">
              <%= f.label :firstChosen, "Elija el primer número" %>
             <%= f.text_field :firstChosen, class: 'form-control' %>              
            </div>
          </div>
          <div class="row">
            <div class="col-md-4">
              <%= f.label :secondChosen, "Elija el segundo número" %>
              <%= f.text_field :secondChosen, class: "form-control" %>
              
            </div>
          </div>
          <div class="row">
            <div class="col-md-4">
              <%= f.label :thirdChosen, "Elija el tercer número" %>
              <%= f.text_field :thirdChosen,  class: 'form-control' %>              
            </div>
          </div>
         <div class="row">
           <div class="col-md-4">
              <%= f.label :fourthChosen, "Elija el cuarto número" %>
              <%= f.text_field :fourthChosen, class: 'form-control' %>             
           </div>
         </div>
          <div class="row">
            <div class="col-md-4">
              <%= f.label :fifthChosen, "Elija el quinto número" %>
              <%= f.text_field :fifthChosen, class: 'form-control' %>              
            </div>
          </div>
         
          </br>
          <%= f.submit "Jugar ya!",class: 'btn btn-primary' %>
        <% end %>
      </div>  
    </div>
  </div>

</div>


<div class="row" style="margin: 10px;">
  
  <div class="col-md-6">
    
    <div class="panel">
      <h3> Numeros Sorteados Anteriormente: </h3>
      <table class="table table-bordered  table-condensed ">
        <thead style="background: gold">
          <th>Fecha</th>          
          <th>Números Sorteados</th>         
        </thead>
        <% @gambleAll.each do |gam| %>     
          <tbdoy>
            <tr>  
            <td><%= gam.created_at %> </td>            
              <td>
                  <%= gam.firstRaffled %>-
                  <%= gam.secondRaffled %>-
                  <%= gam.thirdRaffled %>-
                  <%= gam.fourthRaffled %>-
                  <%= gam.fifthRaffled %>
              </td>                  
            </tr>              
          </tbody>
        <% end %>
      </table>
    </div>
    
  </div>
</div>

